﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ElectronicsMarket_Desktop.BL;

namespace ElectronicsMarket_Desktop
{
    public partial class frmDangNhap : Form
    {
        public frmDangNhap()
        {
            InitializeComponent();
        }

        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            StaffBL staffbl = new StaffBL();
            if (txtTenTuyCap != null && txtMatKhau != null)
            {
                staffbl.Staff.STAFF_SYS_NAME = txtTenTuyCap.Text;
                staffbl.Staff.STAFF_PASSWORD = txtMatKhau.Text;
                if (staffbl.KiemTra())
                {
                    this.Hide();
                    frmMain frmmain = new frmMain();
                    frmmain.Show();
                    StaticParameter.Idnhanvien = staffbl.Staff.STAFF_ID;
                    
                    
                }
                else
                {
                    MessageBox.Show("Tên truy cập không đúng");
                }

            }
        }

        private void frmDangNhap_Load(object sender, EventArgs e)
        {

        }

        private void frmDangNhap_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }

      
    }
}
